//
//  TTMusicBaseTableViewCell.m
//  TTMusic
//
//  Created by yanghuiyan on 16/3/31.
//  Copyright © 2016年 cpy. All rights reserved.
//

#import "TTMusicBaseTableViewCell.h"

@implementation TTMusicBaseTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        NSString *states = [[NSUserDefaults standardUserDefaults]objectForKey:@"night"];
        if ([states isEqualToString:@"yes"]) {
            self.backgroundColor = [UIColor blackColor];
        }else {
            
            self.backgroundColor = [UIColor whiteColor];
        }
        
        
    }
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(changColor:) name:@"changColor" object:nil];
    
    return self;
}


- (void)awakeFromNib {
    // Initialization code
}

-(void)changColor:(NSNotification *)notifiction {
    
    UIColor *color = [notifiction object];
    
    self.backgroundColor = color;
    
    
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
